/**
 * @license
 * Copyright Akveo. All Rights Reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */

@mixin nb-menu-theme() {
  nb-menu {
    font-family: nb-theme(menu-font-family);
    font-size: nb-theme(menu-font-size);
    font-weight: nb-theme(menu-font-weight);
    background: nb-theme(menu-bg);
    color: nb-theme(menu-fg);

    ul.menu-items {
      margin: 0;
      padding: 0;
    }

    .menu-group {
      font-weight: nb-theme(menu-group-font-weight);
      font-size: nb-theme(menu-group-font-size);
      color: nb-theme(menu-group-fg);
      padding: nb-theme(menu-group-padding);
    }

    .menu-item {
      a {
        padding: nb-theme(menu-item-padding);
        border-radius: nb-theme(menu-submenu-item-border-radius);
      }

      a:hover,
      a.active {
        background-color: nb-theme(menu-active-bg);
        color: nb-theme(menu-active-fg);
        font-weight: nb-theme(menu-active-font-weight);

        .menu-icon,
        .chevron {
          color: nb-theme(menu-icon-active-color);
        }
      }

      .menu-icon {
        font-size: nb-theme(menu-icon-font-size);
        width: nb-theme(menu-icon-font-size);
        margin: nb-theme(menu-icon-margin);
        text-align: center;
        color: nb-theme(menu-icon-color);
      }

      .chevron {
        font-size: 0.875rem;
        color: nb-theme(menu-icon-color);
      }
    }

    .menu-items > .menu-item {
      border-bottom: 1px solid nb-theme(menu-item-separator);
      &:first-child {
        border-top: 1px solid nb-theme(menu-item-separator);
      }
    }

    .menu-item > .menu-items {
      background-color: nb-theme(menu-submenu-bg);
    }

    .menu-item > .menu-items > .menu-item {
      border: none;
      background: nb-theme(menu-submenu-bg);
      color: nb-theme(menu-submenu-fg);
      padding: nb-theme(menu-submenu-item-container-padding);

      &:first-child {
        margin-top: nb-theme(menu-submenu-padding);
      }
      &:last-child {
        margin-bottom: nb-theme(menu-submenu-padding);
      }

      a {
        border: nb-theme(menu-submenu-item-border-width) solid nb-theme(menu-submenu-bg);
        padding: nb-theme(menu-submenu-item-padding);
      }

      a:hover {
        color: nb-theme(menu-submenu-hover-fg);
        background: nb-theme(menu-submenu-hover-bg);
      }

      a.active {
        background-color: nb-theme(menu-submenu-active-bg);
        color: nb-theme(menu-submenu-active-fg);
        border-color: nb-theme(menu-submenu-active-border-color);
        box-shadow: nb-theme(menu-submenu-active-shadow);
      }
    }
  }

  nb-menu.inverse {
    .menu-item {
      a {
        color: nb-theme(menu-bg);
      }

      a:hover {
        background-color: nb-theme(menu-active-fg);
        color: nb-theme(menu-active-bg);
      }

      a.active {
        background-color: nb-theme(menu-active-fg);
        color: nb-theme(menu-active-bg);
      }
    }

    .menu-group {
      color: nb-theme(menu-bg);
    }
  }
}
